import Request from "../../core";
// 预下单（不会锁库存）
export const pre_order = (data) => {
	return Request.post("/mall/pub/mobile/order/pre_order", data, {
		isLoading: false,
	});
};
// 获取预下单信息
export const get_pre_order = (data) => {
	return Request.get("/mall/pub/mobile/order/get_pre_order?preNo=" + data.preNo, data, {
		isLoading: false,
	});
};
// 获取店铺与收货地址间的距离
export const queryIntervalDistance = (data) => {
	return Request.get("/mall/pub/mobile/order/queryIntervalDistance", data, {
		isLoading: false,
	});
};
// 创建订单
export const createOrder = (data) => {
	return Request.post("/mall/pub/mobile/order/create", data, {
		isLoading: false,
	});
};

// 获取订单列表
export const order_list = (data) => {
	return Request.post("/mall/pub/mobile/order/order_list", data, {
		isLoading: false,
	});
};

// 获取订单详情
export const get_order_detail = (data) => {
	return Request.get("/mall/pub/mobile/order/get_order_detail?orderNo=" + data.orderNo, data, {
		isLoading: false,
	});
};

// 取消订单
export const cancel = (data) => {
	return Request.post("/mall/pub/mobile/order/cancel", data, {
		isLoading: false,
	});
};

// 完成订单
export const confirm_receipt = (data) => {
	return Request.post("/mall/pub/mobile/order/confirm_receipt?orderNo=" + data.orderNo, data, {
		isLoading: false,
	});
};

// 核销订单
export const writeOff = (data) => {
	return Request.post("/mall/pub/mobile/order/writeOff?orderNoOrCode=" + data.orderNoOrCode, data, {
		isLoading: false,
	});
};
